package com.yuyue.springFramework.note14.dao;

import com.yuyue.springFramework.note14.entity.Person;
import org.springframework.stereotype.Component;

/**
 * 普通类的数据库操作类
 */
@Component
public class PersonDao {
    public void insertTable(Person person){
        //插入数据库方法
        System.out.println("插入表：" + person);
    }

    //维护方法，返回维护记录数
    public Integer updateTable(Person person){
        Integer i = 1;
        System.out.println("维护Person表" + person);

        //制造ArithmeticException异常
        //i = 1/0;
        //制造NullPointerException异常
        person = null;
        System.out.println(person.toString());

        return i;
    }
}